DROP TABLE IF EXISTS jms_dim.dim_lmdm_sys_second_code;
CREATE EXTERNAL TABLE jms_dim.dim_lmdm_sys_second_code_dt(
 ID bigint comment "",  --NUMBER(11)
 CODE string comment "二段码",  --NVARCHAR2(20)
 NETWORK_ID bigint comment "派送网点ID",  --NUMBER(11)
 NETWORK_NAME string comment "派送网点名称",  --NVARCHAR2(60)
 NETWORK_CODE string comment "派送网点编码",  --NVARCHAR2(20)
 COUNTRY_ID bigint comment "国家ID",  --NUMBER(11)
 PROVINCE_ID bigint comment "省份ID",  --NUMBER(11)
 CITY_ID bigint comment "城市ID",  --NUMBER(11)
 AREA_ID bigint comment "区县ID",  --NUMBER(11)
 TOWN_ID bigint comment "乡镇ID",  --NUMBER(11)
 CENTER_ID bigint comment "转运中心ID",  --NUMBER(11)
 CENTER_NAME string comment "转运中心名称",  --NVARCHAR2(60)
 CENTER_CODE string comment "转运中心编码",  --NVARCHAR2(20)
 CENTER_PROVINCE_ID bigint comment "中心所在省份ID",  --NUMBER(11)
 CENTER_CITY_ID bigint comment "中心所在城市ID",  --NUMBER(11)
 CENTER_AREA_ID bigint comment "中心所在区县ID",  --NUMBER(11)
 IS_ENABLE int comment "是否启用:1启用,2不启用",  --NUMBER(6)
 IS_DELETE int comment "是否删除:1未删除,2已删除",  --NUMBER(6)
 CREATE_BY bigint comment "创建人ID",  --NUMBER(11)
 UPDATE_BY bigint comment "最后更新人ID",  --NUMBER(11)
 CREATE_BY_NAME string comment "创建人名称",  --NVARCHAR2(50)
 UPDATE_BY_NAME string comment "最后修改人名称",  --NVARCHAR2(50)
 CREATE_TIME timestamp comment "创建时间",  --DATE
 UPDATE_TIME timestamp comment "更新时间",  --DATE
 VERSION string comment "版本号",  --NVARCHAR2(10)
 SORT int comment "排序",  --NUMBER(6)
 MODIFIED_TIME timestamp comment "记录修改时间",  --DATE
 EFFECT_TIME timestamp comment "生效时间",  --DATE
 INVALID_TIME timestamp comment "失效时间"  --DATE
 )
 COMMENT '二段码维护维表'
  PARTITIONED BY (`dt` string COMMENT '更新/创建日期 (yyyy-MM-dd)')
 STORED AS PARQUET
 LOCATION '/dw/hive/jms_dim.db/external/dim_lmdm_sys_second_code_dt'
 TBLPROPERTIES (
 'discover.partitions'='false',
 'parquet.column.index.access'='true'
 );